﻿#pragma once

#include "Type.h"

#pragma execution_character_set("utf-8")

namespace TCServer
{
    namespace Type
    {
        enum class Province
        {
            Beijing,
            Tianjin,
            Chongqing,
            Shanghai,
            Hebei,
            Sanxi,
            Liaoning,
            Jilin,
            Heilongjiang,
            Jiangsu,
            Zhejiang,
            Anhui,
            Fujian,
            Jiangxi,
            Sandong,
            Henan,
            Hubei,
            Hunan,
            Guangdong,
            Hainan,
            Sichuan,
            Guizhou,
            Yunnan,
            Shanxi,
            Gansu,
            Qinghai,
            Taiwan,
            Mongo,
            Guangxi,
            Tibet,
            Ningxia,
            Xinjiang,
            Hongkong,
            Macao,
        };
        static QString provinceToString(Province province)
        {
            static const QMap<TCServer::Type::Province, QString> strs =
            {
                { TCServer::Type::Province::Beijing, "北京" },
                { TCServer::Type::Province::Tianjin, "天津" },
                { TCServer::Type::Province::Chongqing, "重庆" },
                { TCServer::Type::Province::Shanghai, "上海" },
                { TCServer::Type::Province::Hebei, "河北" },
                { TCServer::Type::Province::Sanxi, "山西" },
                { TCServer::Type::Province::Liaoning, "辽宁" },
                { TCServer::Type::Province::Jilin, "吉林" },
                { TCServer::Type::Province::Heilongjiang, "黑龙江" },
                { TCServer::Type::Province::Jiangsu, "江苏" },
                { TCServer::Type::Province::Zhejiang, "浙江" },
                { TCServer::Type::Province::Anhui, "安徽" },
                { TCServer::Type::Province::Fujian, "福建" },
                { TCServer::Type::Province::Jiangxi, "江西" },
                { TCServer::Type::Province::Sandong, "山东" },
                { TCServer::Type::Province::Henan, "河南" },
                { TCServer::Type::Province::Hubei, "湖北" },
                { TCServer::Type::Province::Hunan, "湖南" },
                { TCServer::Type::Province::Guangdong, "广东" },
                { TCServer::Type::Province::Hainan, "海南" },
                { TCServer::Type::Province::Sichuan, "四川" },
                { TCServer::Type::Province::Guizhou, "贵州" },
                { TCServer::Type::Province::Yunnan, "云南" },
                { TCServer::Type::Province::Shanxi, "陕西" },
                { TCServer::Type::Province::Gansu, "甘肃" },
                { TCServer::Type::Province::Qinghai, "青海" },
                { TCServer::Type::Province::Taiwan, "台湾" },
                { TCServer::Type::Province::Mongo, "内蒙古" },
                { TCServer::Type::Province::Guangxi, "广西" },
                { TCServer::Type::Province::Tibet, "西藏" },
                { TCServer::Type::Province::Ningxia, "宁夏" },
                { TCServer::Type::Province::Xinjiang, "新疆" },
                { TCServer::Type::Province::Hongkong, "香港" },
                { TCServer::Type::Province::Macao, "澳门" }
            };
            return strs[province];
        }
        static Province stringToProvince(const QString &str)
        {
            static const QMap<QString, TCServer::Type::Province> enums =
            {
                { "北京", TCServer::Type::Province::Beijing },
                { "天津", TCServer::Type::Province::Tianjin },
                { "重庆", TCServer::Type::Province::Chongqing },
                { "上海", TCServer::Type::Province::Shanghai },
                { "河北", TCServer::Type::Province::Hebei },
                { "山西", TCServer::Type::Province::Sanxi },
                { "辽宁", TCServer::Type::Province::Liaoning },
                { "吉林", TCServer::Type::Province::Jilin },
                { "黑龙江", TCServer::Type::Province::Heilongjiang },
                { "江苏", TCServer::Type::Province::Jiangsu },
                { "浙江", TCServer::Type::Province::Zhejiang },
                { "安徽", TCServer::Type::Province::Anhui },
                { "福建", TCServer::Type::Province::Fujian },
                { "江西", TCServer::Type::Province::Jiangxi },
                { "山东", TCServer::Type::Province::Sandong },
                { "河南", TCServer::Type::Province::Henan },
                { "湖北", TCServer::Type::Province::Hubei },
                { "湖南", TCServer::Type::Province::Hunan },
                { "广东", TCServer::Type::Province::Guangdong },
                { "海南", TCServer::Type::Province::Hainan },
                { "四川", TCServer::Type::Province::Sichuan },
                { "贵州", TCServer::Type::Province::Guizhou },
                { "云南", TCServer::Type::Province::Yunnan },
                { "陕西", TCServer::Type::Province::Shanxi },
                { "甘肃", TCServer::Type::Province::Gansu },
                { "青海", TCServer::Type::Province::Qinghai },
                { "台湾", TCServer::Type::Province::Taiwan },
                { "内蒙古", TCServer::Type::Province::Mongo },
                { "广西", TCServer::Type::Province::Guangxi },
                { "西藏", TCServer::Type::Province::Tibet },
                { "宁夏", TCServer::Type::Province::Ningxia },
                { "新疆", TCServer::Type::Province::Xinjiang },
                { "香港", TCServer::Type::Province::Hongkong },
                { "澳门", TCServer::Type::Province::Macao }
            };
            return enums[str];
        }
    }
}
TC_DECLARE_ENUM(Province, TCServer::Type::Province)
